(component
  (type (;0;)
    (instance
      (type (;0;) (record (field "f" u32)))
      (export (;1;) "r1" (type (eq 0)))
      (type (;2;) (record (field "r1" 1)))
      (export (;3;) "r2" (type (eq 2)))
    )
  )
  (import "a:b/type-def" (instance (;0;) (type 0)))
  (alias export 0 "r1" (type (;1;)))
  (alias export 0 "r2" (type (;2;)))
  (type (;3;)
    (instance
      (alias outer 1 1 (type (;0;)))
      (export (;1;) "r1" (type (eq 0)))
      (alias outer 1 2 (type (;2;)))
      (export (;3;) "r2" (type (eq 2)))
    )
  )
  (import "a:b/type-use" (instance (;1;) (type 3)))
  (type (;4;)
    (instance
      (type (;0;) u32)
      (export (;1;) "t1" (type (eq 0)))
      (export (;2;) "t2" (type (eq 1)))
    )
  )
  (import "a:b/type-use-in-same-interface" (instance (;2;) (type 4)))
  (type (;5;)
    (instance
      (type (;0;) u32)
      (export (;1;) "t" (type (eq 0)))
    )
  )
  (import "a:b/diamond-base" (instance (;3;) (type 5)))
  (alias export 3 "t" (type (;6;)))
  (type (;7;)
    (instance
      (alias outer 1 6 (type (;0;)))
      (export (;1;) "t" (type (eq 0)))
    )
  )
  (import "a:b/diamond1" (instance (;4;) (type 7)))
  (alias export 3 "t" (type (;8;)))
  (type (;9;)
    (instance
      (alias outer 1 8 (type (;0;)))
      (export (;1;) "t" (type (eq 0)))
    )
  )
  (import "a:b/diamond2" (instance (;5;) (type 9)))
  (alias export 4 "t" (type (;10;)))
  (alias export 5 "t" (type (;11;)))
  (type (;12;)
    (instance
      (alias outer 1 10 (type (;0;)))
      (export (;1;) "t1" (type (eq 0)))
      (alias outer 1 11 (type (;2;)))
      (export (;3;) "t2" (type (eq 2)))
    )
  )
  (import "a:b/diamond-join" (instance (;6;) (type 12)))
  (component (;0;)
    (type (;0;)
      (instance)
    )
    (import "a" (instance (;0;) (type 0)))
  )
  (component (;1;)
    (type (;0;)
      (instance
        (type (;0;) (record (field "f" u32)))
        (export (;1;) "r1" (type (eq 0)))
        (type (;2;) (record (field "r1" 1)))
        (export (;3;) "r2" (type (eq 2)))
      )
    )
    (import "a:b/type-def" (instance $type-def (;0;) (type 0)))
    (alias export $type-def "r1" (type $r1 (;1;)))
    (alias export $type-def "r2" (type $r2 (;2;)))
    (type (;3;)
      (instance
        (alias outer 1 $r1 (type (;0;)))
        (export (;1;) "r1" (type (eq 0)))
        (alias outer 1 $r2 (type (;2;)))
        (export (;3;) "r2" (type (eq 2)))
      )
    )
    (import "a:b/type-use" (instance (;1;) (type 3)))
    (type (;4;)
      (instance
        (type (;0;) u32)
        (export (;1;) "t1" (type (eq 0)))
        (export (;2;) "t2" (type (eq 1)))
      )
    )
    (import "a:b/type-use-in-same-interface" (instance (;2;) (type 4)))
    (type (;5;)
      (instance
        (type (;0;) u32)
        (export (;1;) "t" (type (eq 0)))
      )
    )
    (import "a:b/diamond-base" (instance $diamond-base (;3;) (type 5)))
    (alias export $diamond-base "t" (type $t-diamond-base (;6;)))
    (type (;7;)
      (instance
        (alias outer 1 $t-diamond-base (type (;0;)))
        (export (;1;) "t" (type (eq 0)))
      )
    )
    (import "a:b/diamond1" (instance $diamond1 (;4;) (type 7)))
    (type (;8;)
      (instance
        (alias outer 1 $t-diamond-base (type (;0;)))
        (export (;1;) "t" (type (eq 0)))
      )
    )
    (import "a:b/diamond2" (instance $diamond2 (;5;) (type 8)))
    (alias export $diamond1 "t" (type $t-diamond1 (;9;)))
    (alias export $diamond2 "t" (type $t-diamond2 (;10;)))
    (type (;11;)
      (instance
        (alias outer 1 $t-diamond1 (type (;0;)))
        (export (;1;) "t1" (type (eq 0)))
        (alias outer 1 $t-diamond2 (type (;2;)))
        (export (;3;) "t2" (type (eq 2)))
      )
    )
    (import "a:b/diamond-join" (instance (;6;) (type 11)))
  )
  (instance (;7;) (instantiate 1
      (with "a:b/type-def" (instance 0))
      (with "a:b/type-use" (instance 1))
      (with "a:b/type-use-in-same-interface" (instance 2))
      (with "a:b/diamond-base" (instance 3))
      (with "a:b/diamond1" (instance 4))
      (with "a:b/diamond2" (instance 5))
      (with "a:b/diamond-join" (instance 6))
    )
  )
  (instance (;8;) (instantiate 0
      (with "a" (instance 7))
    )
  )
)
